No need for filecache.el to load find-lisp when compiling
authorGlenn Morris <rgm@gnu.org>
Fri, 2 Nov 2012 22:44:38 +0000 (18:44 -0400)
committerGlenn Morris <rgm@gnu.org>
Fri, 2 Nov 2012 22:44:38 +0000 (18:44 -0400)
* lisp/filecache.el (find-lisp-find-files): Autoload it.
(file-cache-add-directory-recursively): Don't require find-lisp.

lisp/ChangeLog
lisp/filecache.el

index 801dcde2ba94abd1c1e1b3bab8196fb04ecff6e9..07f0245ea93736319800ec7c5ce105a6817a1923 100644 (file)
@@ -1,5 +1,9 @@
 2012-11-02  Glenn Morris  <rgm@gnu.org>
 
+       * filecache.el: No need to load find-lisp when compiling.
+       (find-lisp-find-files): Autoload it.
+       (file-cache-add-directory-recursively): Don't require find-lisp.
+
        * image.el (image-type-from-file-name): Trivial simplification.
 
        * emacs-lisp/bytecomp.el (byte-compile-eval):
index 10e23bddca2847d4e65b0d47e931e64db0e55102..2dd7c2673bf7a7d3d1e1d9760a0f6b6edea63cd5 100644 (file)
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'find-lisp))
-
 (defgroup file-cache nil
   "Find files using a pre-loaded cache."
   :group 'files
@@ -366,6 +363,8 @@ STRING is passed as an argument to the locate command."
                string)
   (file-cache-add-from-file-cache-buffer))
 
+(autoload 'find-lisp-find-files "find-lisp")
+
 ;;;###autoload
 (defun file-cache-add-directory-recursively  (dir &optional regexp)
   "Adds DIR and any subdirectories to the file-cache.
@@ -374,18 +373,16 @@ If the optional REGEXP argument is non-nil, only files which match it
 will be added to the cache.  Note that the REGEXP is applied to the
 files in each directory, not to the directory list itself."
   (interactive "DAdd directory: ")
-  (require 'find-lisp)
   (mapcar
-   (function
-    (lambda (file)
-      (or (file-directory-p file)
-         (let (filtered)
-           (dolist (regexp file-cache-filter-regexps)
-              (and (string-match regexp file)
-                   (setq filtered t)))
-            filtered)
-         (file-cache-add-file file))))
-   (find-lisp-find-files dir (if regexp regexp "^"))))
+   (lambda (file)
+     (or (file-directory-p file)
+         (let (filtered)
+           (dolist (regexp file-cache-filter-regexps)
+             (and (string-match regexp file)
+                  (setq filtered t)))
+           filtered)
+         (file-cache-add-file file)))
+   (find-lisp-find-files dir (or regexp "^"))))
 
 (defun file-cache-add-from-file-cache-buffer (&optional regexp)
   "Add any entries found in the file cache buffer.